<h1><?php print( $h1 ); ?></h1>

<?php print form_open( 'form/mail/'.$form_id, array( 'class' => 'horizontal' ) ); ?>
    <?php echo $description; ?>
    <fieldset>
        <ol>
	        <?php
			if( !empty( $text ) ){
				foreach( $text as $key => $value ){
					?>
					<li class="formfield">
		                <?php print form_label( $value['label'], $value['name'] )?>
		                <?php 
		                switch( $value['type'] ){
		                	case 'text':
		                		print form_input( $value['name'], '', 'id="'.$value['name'].'" class="text"' );
		                		break;
		                	case 'textarea':
		                		print form_textarea( $value['name'], '', 'id="'.$value['name'].'" class="text"' );
		                		break;
		                	case 'checkbox':
		                		$checkbox = array( 'name' => $value['name'], 'value' => 'Ja', 'id' => $value['name'], 'class' => 'checkbox' );
		                		print form_checkbox( $checkbox );
		                		break;
						} ?>
		            </li>
		            <?php 
				} //foreach
			} //if
			?>
            <li class="submit">
                <div class="buttons">
	                <button type="submit" class="positive-form" name="submit" value="submit">
	                </button>
	                <a href="<?php print current_url( )?>" class="negative-form">&nbsp;
	                </a>
	            </div>
            </li>
        </ol>
    </fieldset>
<?php print form_close( )?>
